<template>
  <div style="padding-bottom: 5px">
    <el-row style="text-align: right;">
      <el-button-group>
        <el-button size="mini" type="primary" icon="el-icon-plus" @click="create()">新  建</el-button>
      </el-button-group>
      <el-dropdown v-if="items.length > 0" trigger="click">
        <el-button size="mini" icon="el-icon-s-grid">
          <i class="el-icon-arrow-down el-icon--right" />
        </el-button>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item v-for="item in items" :key="item.ID">
            <el-link :underline="false" @click="itemclient(item.clientevent)">
              <i class="el-icon-setting el-icon--right" />&nbsp;{{ item.name }}
            </el-link>
          </el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </el-row>
  </div>
</template>
<script>
export default {
  props: {
    items: {
      type: Array,
      // eslint-disable-next-line vue/require-valid-default-prop
      default: []
    }

  },
  data() {
    return {

    }
  },
  methods: {
    itemclient(eventname) {
      eventname()
    },
    create() {
      this.$emit('create')
    }
  }
}
</script>
<style>
.el-dropdown-link {
    cursor: pointer;
    color: #409eff;
}
</style>
